package facade;

import subsystem_classes.CPU;
import subsystem_classes.HardDrive;
import subsystem_classes.Memory;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025/5/10
 * Time: 13:17
 */

public class Facade {
    private final CPU cpu;
    private final Memory memory;
    private final HardDrive hardDrive;
    public Facade() {
        this.cpu = new CPU();
        this.memory = new Memory();
        this.hardDrive = new HardDrive();
    }
    public void start(){
        System.out.println("启动计算机");
        cpu.open();
        memory.open();
        hardDrive.open();
        System.out.println("计算机启动完成");
    }
    public void close(){
        System.out.println("关闭计算机");
        cpu.close();
        memory.close();
        hardDrive.close();
        System.out.println("计算机已关闭");
    }
}
